import { http } from "@/utils/http"
import type { OrderPreResult, OrderCreateParams } from '@/types/order'

export const getMemberOrderPreAPI = () => {
    return http<OrderPreResult>({
        method: 'GET',
        url: '/member/order/pre',
    })
}

export const getMemberOrderPreNowAPI = (data: { skuId: string, count: string, addressId?: string }) => {
    return http<OrderPreResult>({
        method: 'GET',
        url: '/member/order/pre/now',
        data
    })
}

export const postMemberOrderAPI = (data: { OrderCreateParams }) => {
    return http<{ id: string }>({
        method: 'POST',
        url: '/member/order',
        data
    })
}